using System;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;

namespace PCRSim
{
  class PCRSim
  {
    byte[] buffer = new byte[1024];

    static void Main()
    {
      PCRSim sim = new PCRSim();
      sim.listen();
    }

    SerialPort port = new SerialPort("COM5");

    public PCRSim()
    {
      port.Open();
    }

    public void listen()
    {
      Response response = new Response();
      if (port.IsOpen == false)
        return;

      int len = 0;
      while (true)
      {
        response.ReadCommand(port);
        System.Windows.Forms.Application.DoEvents();
      }
    }

  }
}
